#include<stdio.h>
#include "func.h"
/*
最后编写时间:2025/7/18
作者:dgg
gitee地址：https://gitee.com/ccc-dgg/c-language-data-structure.git

删除功能还没封装进来，可以在2-3的示例中修改模板然后封装进来
*/

int main(int argc, char **argv){

    pLink_List_t phead =Double_Cycle_Link_List_Init();

    Double_Cycle_Link_List_Head_Insert(phead,Create_new_node(phead,"C语言程序设计",251,"黄色"));
    Double_Cycle_Link_List_Head_Insert(phead, Create_new_node(phead,"C++程序设计",150,"红色"));
    Double_Cycle_Link_List_Head_Insert(phead,Create_new_node(phead,"Java程序设计",500,"绿色"));
    Double_Cycle_Link_List_Head_Insert(phead,Create_new_node(phead,"PHP程序设计",170,"蓝色"));
    Double_Cycle_Link_List_Head_Insert(phead,Create_new_node(phead,"JavaScript程序设计",180,"白色"));
    Double_Cycle_Link_List_Head_Insert(phead,Create_new_node(phead,"C#程序设计",200,"灰色"));
    Double_Cycle_Link_List_Head_Insert(phead,Create_new_node(phead,"Ruby程序设计",300,"黑色"));
    Double_Cycle_Link_List_Head_Insert(phead,Create_new_node(phead,"Python程序设计",250,"紫色"));
    
    int fun=0;
    Menu();
    scanf("%d",&fun);
    printf("\n");
    
    
   
    while(fun!=8)
    {
        switch(fun)
        {
            case 1:
                Print_Link_List_next(phead);
                break;
            case 2:
                Double_Cycle_Link_List_Head_Insert(phead,Create_new_node_scanf(phead));
                break;
            case 3:
                Double_Cycle_Link_List_Search(phead);
                break;
            case 4:
                Double_Cycle_Link_List_Random_Delet(phead);
                break;
            case 5:
                Double_Cycle_Link_List_Modify(phead);
                break;
            case 6:
                Flip_book(phead);
                break;
            case 7:
                Double_Cycle_Link_list_Sort(phead);
                break;
            case 8:
                printf("已经退出程序\n");
                Release_Cycle_Link_list(phead);
                break;      
            default:
                printf("输入错误\n");
                break;
        }
        Menu();
        scanf("%d",&fun);
        printf("\n");
    }
    

  
    return 0;
}